import { isWorkWeiXin, isDingTalk, isOpenData } from '@src/util/platform'
import CommonPlatform from '@src/platform/extension/common'
import WXPlatform from '@src/platform/extension/wechat'
import DingDingPlatform from '@src/platform/extension/dingding'

let Platform: CommonPlatform | WXPlatform | DingDingPlatform = new CommonPlatform()

if (window.wx || isWorkWeiXin() || isOpenData) {
  Platform = new WXPlatform()
}
else if (isDingTalk()) {
  Platform = new DingDingPlatform()
}

export default Platform